package com.dream.service.impl;

import com.dream.dao.DormitoryDao;
import com.dream.dao.impl.DormitoryDaoImpl;
import com.dream.pojo.Department;
import com.dream.pojo.Dormitory;
import com.dream.service.DormitoryService;

import java.util.List;

public class DormitoryServiceImpl implements DormitoryService {
    DormitoryDao dormitoryDao = new DormitoryDaoImpl();
    @Override
    public List<Dormitory> list(String dormitoryId, long pageIndex, long pageSize) {
        return dormitoryDao.list( dormitoryId,  pageIndex,  pageSize);
    }

    @Override
    public Dormitory findById(String dormitoryId) {
        return dormitoryDao.findById(dormitoryId);
    }

    @Override
    public long totalCount(String dormitoryId) {
        return dormitoryDao.totalCount(dormitoryId);
    }

    public int add(Dormitory dormitory) {
        return dormitoryDao.add(dormitory);
    }

    @Override
    public int update(Dormitory dormitory) {
        return dormitoryDao.update(dormitory);
    }

    @Override
    public int deleteById(String dormitoryId) {
        return dormitoryDao.deleteById(dormitoryId);
    }

    @Override
    public List<Dormitory> list() {
        return dormitoryDao.list();
    }
}
